+Thu Feb 26 22:20:44 2004 Matthias Clasen <maclas@gmx.de>
+
+ * gtk/gtkcomboboxentry.h:
+ * gtk/gtkcomboboxentry.c (gtk_combo_box_entry_new_text): New
+ convenience API to construct simple text combos, implemented by
+ Damon Chaplin.
+
+ * tests/testcombo.c: Use gtk_combo_box_entry_new_text.
+
+Thu Feb 26 22:19:29 2004 Matthias Clasen <maclas@gmx.de>
+
+ * gtk/gtkcombobox.c (gtk_combo_box_new_text): Improve the docs.
+
Thu Feb 26 15:43:43 2004 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.[ch]: Export insertion cursor drawing functionality
+Thu Feb 26 22:20:44 2004 Matthias Clasen <maclas@gmx.de>
+
+ * gtk/gtkcomboboxentry.h:
+ * gtk/gtkcomboboxentry.c (gtk_combo_box_entry_new_text): New
+ convenience API to construct simple text combos, implemented by
+ Damon Chaplin.
+
+ * tests/testcombo.c: Use gtk_combo_box_entry_new_text.
+
+Thu Feb 26 22:19:29 2004 Matthias Clasen <maclas@gmx.de>
+
+ * gtk/gtkcombobox.c (gtk_combo_box_new_text): Improve the docs.
+
Thu Feb 26 15:43:43 2004 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.[ch]: Export insertion cursor drawing functionality
+Thu Feb 26 22:20:44 2004 Matthias Clasen <maclas@gmx.de>
+
+ * gtk/gtkcomboboxentry.h:
+ * gtk/gtkcomboboxentry.c (gtk_combo_box_entry_new_text): New
+ convenience API to construct simple text combos, implemented by
+ Damon Chaplin.
+
+ * tests/testcombo.c: Use gtk_combo_box_entry_new_text.
+
+Thu Feb 26 22:19:29 2004 Matthias Clasen <maclas@gmx.de>
+
+ * gtk/gtkcombobox.c (gtk_combo_box_new_text): Improve the docs.
+
Thu Feb 26 15:43:43 2004 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.[ch]: Export insertion cursor drawing functionality
+Thu Feb 26 22:20:44 2004 Matthias Clasen <maclas@gmx.de>
+
+ * gtk/gtkcomboboxentry.h:
+ * gtk/gtkcomboboxentry.c (gtk_combo_box_entry_new_text): New
+ convenience API to construct simple text combos, implemented by
+ Damon Chaplin.
+
+ * tests/testcombo.c: Use gtk_combo_box_entry_new_text.
+
+Thu Feb 26 22:19:29 2004 Matthias Clasen <maclas@gmx.de>
+
+ * gtk/gtkcombobox.c (gtk_combo_box_new_text): Improve the docs.
+
Thu Feb 26 15:43:43 2004 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.[ch]: Export insertion cursor drawing functionality
+Thu Feb 26 22:20:44 2004 Matthias Clasen <maclas@gmx.de>
+
+ * gtk/gtkcomboboxentry.h:
+ * gtk/gtkcomboboxentry.c (gtk_combo_box_entry_new_text): New
+ convenience API to construct simple text combos, implemented by
+ Damon Chaplin.
+
+ * tests/testcombo.c: Use gtk_combo_box_entry_new_text.
+
+Thu Feb 26 22:19:29 2004 Matthias Clasen <maclas@gmx.de>
+
+ * gtk/gtkcombobox.c (gtk_combo_box_new_text): Improve the docs.
+
Thu Feb 26 15:43:43 2004 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.[ch]: Export insertion cursor drawing functionality
+Thu Feb 26 22:18:21 2004 Matthias Clasen <maclas@gmx.de>
+
+ * gtk/gtk-sections.txt: Add gtk_combo_box_entry_new_text.
+
Thu Feb 26 21:41:25 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtk-sections.txt: Add gtk_rc_reset_styles.
GtkComboBoxEntry
gtk_combo_box_entry_new
gtk_combo_box_entry_new_with_model
+gtk_combo_box_entry_new_text
gtk_combo_box_entry_set_text_column
gtk_combo_box_entry_get_text_column
<SUBSECTION Standard>
*
* Convenience function which constructs a new text combo box, which is a
* #GtkComboBox just displaying strings. If you use this function to create
- * a text combo box, you only want to manipulate it's data source with the
+ * a text combo box, you should only manipulate its data source with the
* following convenience functions: gtk_combo_box_append_text(),
- * gtk_combo_box_insert_text() and gtk_combo_box_prepend_text().
+ * gtk_combo_box_insert_text(), gtk_combo_box_prepend_text() and
+ * gtk_combo_box_remove_text().
*
* Return value: A new text combo box.
*
return TRUE;
}
+
+
+/* convenience API for simple text combos */
+
+/**
+ * gtk_combo_box_entry_new_text:
+ *
+ * Convenience function which constructs a new editable text combo box, which
+ * is a #GtkComboBoxEntry just displaying strings. If you use this function to
+ * create a text combo box, you should only manipulate its data source with
+ * the following convenience functions: gtk_combo_box_append_text(),
+ * gtk_combo_box_insert_text(), gtk_combo_box_prepend_text() and
+ * gtk_combo_box_remove_text().
+ *
+ * Return value: A new text #GtkComboBoxEntry.
+ *
+ * Since: 2.4
+ */
+GtkWidget *
+gtk_combo_box_entry_new_text (void)
+{
+ GtkWidget *entry_box;
+ GtkListStore *store;
+
+ store = gtk_list_store_new (1, G_TYPE_STRING);
+
+ entry_box = gtk_combo_box_entry_new_with_model (GTK_TREE_MODEL (store), 0);
+
+ return entry_box;
+}
gint text_column);
gint gtk_combo_box_entry_get_text_column (GtkComboBoxEntry *entry_box);
+/* convenience -- text */
+GtkWidget *gtk_combo_box_entry_new_text (void);
+
G_END_DECLS
return GTK_TREE_MODEL (store);
}
-static GtkTreeModel *
-create_text_store ()
+static void
+setup_combo_entry (GtkWidget *entry_box)
{
- GtkTreeIter iter;
- GtkListStore *store;
-
- store = GTK_LIST_STORE (gtk_list_store_new (1, G_TYPE_STRING));
-
- gtk_list_store_append (store, &iter);
- gtk_list_store_set (store, &iter, 0, "dum de dum", -1);
-
- gtk_list_store_append (store, &iter);
- gtk_list_store_set (store, &iter, 0, "la la la", -1);
-
- gtk_list_store_append (store, &iter);
- gtk_list_store_set (store, &iter, 0, "la la la dum de dum la la la la la la boom de da la la", -1);
-
- gtk_list_store_append (store, &iter);
- gtk_list_store_set (store, &iter, 0, "bloop", -1);
-
- gtk_list_store_append (store, &iter);
- gtk_list_store_set (store, &iter, 0, "bleep", -1);
-
- gtk_list_store_append (store, &iter);
- gtk_list_store_set (store, &iter, 0, "klaas", -1);
-
- return GTK_TREE_MODEL (store);
+ gtk_combo_box_append_text (GTK_COMBO_BOX (entry_box),
+ "dum de dum");
+ gtk_combo_box_append_text (GTK_COMBO_BOX (entry_box),
+ "la la la");
+ gtk_combo_box_append_text (GTK_COMBO_BOX (entry_box),
+ "la la la dum de dum la la la la la la boom de da la la");
+ gtk_combo_box_append_text (GTK_COMBO_BOX (entry_box),
+ "bloop");
+ gtk_combo_box_append_text (GTK_COMBO_BOX (entry_box),
+ "bleep");
+ gtk_combo_box_append_text (GTK_COMBO_BOX (entry_box),
+ "klaas");
}
int
gtk_container_set_border_width (GTK_CONTAINER (boom), 5);
gtk_container_add (GTK_CONTAINER (tmp), boom);
- comboboxtext = gtk_combo_box_entry_new_with_model (create_text_store (), 0);
+ comboboxtext = gtk_combo_box_entry_new_text ();
+ setup_combo_entry (comboboxtext);
gtk_container_add (GTK_CONTAINER (boom), comboboxtext);
/* done */